/**
 * 
 */
package demo.web.ui.ctrl;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.select.SelectorComposer;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zk.ui.util.Composer;
import org.zkoss.zul.Intbox;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;

import demo.model.DAOs;
import demo.model.bean.Acces;
import demo.model.bean.User;

/**
 * @author virgil
 *
 */
public class EnregistrerAccesCtrl extends SelectorComposer<Window> {
	
	private Acces newUser ;

	@Wire
	private Textbox AccesName_txb;
	
	@Wire
	private Textbox AccesDescription_txb;
	
	@Wire
	private Textbox AccesRue_txb;
	
	@Wire
	private Textbox AccesVille_txb;
	
	@Wire
	private Intbox AccesCP_txb;
	
	@Listen("onClick=#CreerAccesBtn")
	public void confirm() {
		doLogin();
	}

	private void doLogin() {
		Acces acces= new Acces(AccesName_txb.getValue(), AccesDescription_txb.getValue(), 
				AccesRue_txb.getValue(), AccesVille_txb.getValue(), AccesCP_txb.getValue());
		DAOs.getAccesDAO().add(acces);
		// TODO Auto-generated method stub
		
	}

	

}
